package chai.ning.constant;

/**
 * 1、通过包装类来获取其相应的基本类型的最大值( MAX_VALUE )和最小值( MIN_VALUE )
 * 2、不要死记每种数据类型的最大值最小值，建议使用16进制来描述各种整数类型的最大值和最小值
 * 3、浮点数的表示方式与整数不同，float 和 double 都遵守 IEEE 754 标准
 */
public class ConstantTest1 {

	public static void main(String[] args) {
		
		byte byteMax = 0x7F ;// 0111_1111 ;
		System.out.println( byteMax );
		byte byteMin = (byte)0x80 ; // 1000_0000 ;
		System.out.println( byteMin );
		System.out.println( "byte max value : " + Byte.MAX_VALUE );
		System.out.println( "byte min value : " + Byte.MIN_VALUE );

		System.out.println( 0x7FFF + " , " + (short) 0x8000 );
		System.out.println( "short max value : " + Short.MAX_VALUE ); // 0x7FFF
		System.out.println( "short min value : " + Short.MIN_VALUE ); // (short) 0x8000
		
		System.out.println( 0x7FFFFFFF + " , " + 0x80000000 );
		System.out.println( "int max value : " + Integer.MAX_VALUE ); // 0x7FFFFFFF
		System.out.println( "int min value : " + Integer.MIN_VALUE ); // 0x80000000
		
		System.out.println( 0x7FFFFFFFFFFFFFFFL + " , " + 0x8000000000000000L );
		System.out.println( "long max value : " + Long.MAX_VALUE ); // 0x7FFFFFFFFFFFFFFFL
		System.out.println( "long min value : " + Long.MIN_VALUE ); // 0x8000000000000000L
		
		System.out.println( "- - - - - - - - - - - - - - - -" );
		
		System.out.println( "float max value : " + Float.MAX_VALUE );
		System.out.println( "float min value : " + Float.MIN_VALUE );
		
		System.out.println( "double max value : " + Double.MAX_VALUE );
		System.out.println( "double min value : " + Double.MIN_VALUE );
		
	}

}
